package com.abner.springcloud.consumer.ribbon;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: Abner.Jiang
 * @Description:
 * @Date: Created on 2019/12/17 16:58
 * @ProjectName: springcloud-provider-user
 */
@Configuration
public class RibbonConfiguration {

    @Bean
    public IRule ribbonRule(){
        // 负载均衡规则，改为随机
        return new RandomRule();
        // 轮询
//        return new RoundRobinRule();
    }
}
